package utility;

public class Conversione {
 
	/**
	 * @param args
	 */
	
	public String getTime(long x){
	
		if(x<60){
			return "0day - 0h 0m "+x+"s";
		}
		if(x>60 && x<3600){
			int min=0;
			int sec=0;
			min = (int) (x/60);
			sec = (int) x % 60;
			return "0day - 0h "+min+"m "+sec+"s";
		}
		if(x>= 3600 && x<86400){
			int ore = (int)x/3600;
			int rest = (int)x%3600;
			int min,sec;
			if(rest > 0){
				min = (int) rest/60;
				sec = (int) rest % 60;
			}else {
				min = 0;
				sec = 0;
			}
			return "0day - "+ ore+ "h "+min+"m "+sec+"s";
		}
		if (x > 86400){
			int day,ore,min,sec,rest;
			day = (int) x / 86400;
			rest = (int) x % 86400;
			ore = (int) rest / 3600;
			rest = (int) rest % 3600;
			min = (int) rest / 60;
			sec = (int) rest % 60;
			return day + "day - "+ ore+ "h "+min+"m "+sec+"s";

		}
		
		
		
		return "";
	}
	
	public static void main(String[] args) {
		Conversione cv = new Conversione();
		System.out.println(cv.getTime(90000));
		
	}
	
	

}
